<template>
  <div>
    <p>当前计数：{{ counter.count }}</p>
    <button @click="counter.increment()">+1</button>
    <button @click="counter.decrement()">-1</button>
    <div @click="getStorage">获取本地缓存</div>
  </div>

  <div>
    <!-- #ifdef H5 -->
    <div>Button测试测试H5</div>
    <!-- #endif -->
  </div>
</template>

<script setup>
import { useCounterStore } from '@/store/counterStore'
import Taro from '@tarojs/taro'
const counter = useCounterStore()

const getStorage = () => {
  console.log('本地缓存', Taro.getStorageSync('counter'))
}

// #ifdef weapp
console.log('当前运行环境是微信小程序')
console.log(process.env.TARO_ENV, Taro.getEnv())
// #endif

// #ifdef H5
console.log('当前运行环境是 H5')
console.log(process.env.TARO_ENV, Taro.getEnv())
// #endif
</script>

<style lang="less" scoped></style>
